package com.morningstar.qs.basic.db.bean;

import java.util.Date;

import org.apache.commons.beanutils.BeanUtils;

import com.morningstar.qs.basic.db.util.BeanBase;

public class MessageContact extends BeanBase implements  java.io.Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 2177850706709199196L;
	
	private int ownerUserId;
	private String contactAddress;
	private Date createTime;
	
	public int getOwnerUserId() {
		return ownerUserId;
	}

	public void setOwnerUserId(int ownerUserId) {
		this.ownerUserId = ownerUserId;
	}

	public String getContactAddress() {
		return contactAddress;
	}

	public void setContactAddress(String contactAddress) {
		this.contactAddress = contactAddress;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}


	public MessageContact() {
	}
	
	public MessageContact(int ownerUserId, String contactAddress, Date createTime) {
		this.ownerUserId = ownerUserId;
		this.contactAddress = contactAddress;
		this.createTime = createTime;
	}
	
	public MessageContact toDto() {
		MessageContact dto=null;
		
		try {
			dto=new MessageContact();
			BeanUtils.copyProperties(dto, this);
		} catch (Exception e) {
			e.printStackTrace();
		} 
		return dto;
	}
	
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("ownerUserId:").append(this.ownerUserId);
		sb.append("contactAddress:\t").append(contactAddress);
		sb.append("createTime:\t").append(createTime);
		return sb.toString();
	}
}
